#
# BEGIN SONGBIRD GPL
#
# This file is part of the Songbird web player.
#
# Copyright(c) 2008 POTI, Inc.
# http://songbirdnest.com
#
# This file may be licensed under the terms of of the
# GNU General Public License Version 2 (the "GPL").
#
# Software distributed under the License is distributed
# on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
# express or implied. See the GPL for the specific language
# governing rights and limitations.
#
# You should have received a copy of the GPL along with this
# program. If not, go to http://www.gnu.org/licenses/gpl.html
# or write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# END SONGBIRD GPL
#

DEPTH = ../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

include $(DEPTH)/build/autodefs.mk

# the name of our component
target_name = sbalbumviews

# build a component (ie: a dynamically loadable module)
IS_COMPONENT = 1

# ~= mozilla build system's REQUIRES
EXTRA_CPP_INCLUDES = \
                     nspr          \
                     xpconnect     \
                     string        \
                     pref          \
                     necko         \
                     content       \
                     xpcom         \
                     $(NULL)

CPP_SRCS = sbAlbumServiceModule.cpp \
           sbAlbumService.cpp \
           sbAlbumViewScan.cpp \
           $(NULL)

CPP_INCLUDES = ../public \
               $(NULL)

# build a library - DLL_SUFFIX is the platform-specific file extensions for
# dynamic libraries (.so on unix, .dll on windows, etc)
DYNAMIC_LIB = $(target_name)$(DLL_SUFFIX)

# compile our C++ files into the component
DYNAMIC_LIB_OBJS = $(CPP_SRCS:.cpp=$(OBJ_SUFFIX))

# our component depends on these mozilla libraries
DYNAMIC_LIB_EXTRA_IMPORTS = plds4 \
                            nspr4 \
                            xpcom \
                            xpcomglue_s \
                            $(NULL)

DYNAMIC_LIB_IMPORT_PATHS = $(MOZSDK_LIB_DIR) \
                           $(NULL)

DYNAMIC_LIB_STATIC_IMPORTS = $(SONGBIRD_OBJDIR)/components/moz/strings/src/sbMozStringUtils$(DEBUG:%=_d) \
                             $(NULL)

CPP_INCLUDES += $(DEPTH)/components/mediacore/base/public \
                $(DEPTH)/components/library/base/public \
                $(DEPTH)/components/property/public \
                $(DEPTH)/components/job/public \
                $(topsrcdir)/components/include \
                $(topsrcdir)/components/property/src \
                $(topsrcdir)/components/moz/strings/src \
                $(topsrcdir)/components/library/base/src/static \
                $(MOZSDK_INCLUDE_DIR) \
                $(MOZSDK_IDL_DIR) \
                $(MOZSDK_INCLUDE_DIR)/xpcom \
                $(addprefix $(MOZSDK_INCLUDE_DIR)/,$(EXTRA_CPP_INCLUDES)) \
                $(NULL)

# put this in our staging directory
EXTENSION_STAGE_DIR = $(SONGBIRD_OBJDIR)/extensions/albumview/.xpistage

include $(topsrcdir)/build/rules.mk

libs::
	$(INSTALL_PROG) $(DYNAMIC_LIB) $(SONGBIRD_COMPONENTSDIR)

